<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>跳转页面</title>
</head>
<body>
    <p>{{ info }}还用<span id="sp">5</span>秒跳转到{{ page }}界面......</p>
    <input hidden="hidden" id="judge" value="{{ boole }}">
    <script type="text/javascript" language="JavaScript">
        var i = 4;
        var cleartim;
        var judge = document.getElementById('judge').value;
        console.log(judge);
        cleartim = setInterval("reduce_time()", 1000);
        function reduce_time() {
            if(i == 0){
                // 跳转网页
                if(judge === "成功"){
                    window.location.href='{% url 'student_myapp:student_login' %}';
                }else if (judge === "登录失败"){
                    window.location.href='{% url 'student_myapp:student_login' %}';
                }else if (judge === "注册失败"){
                    window.location.href='{% url 'student_myapp:registered' %}'
                }else if (judge === "重置密码失败"){
                    window.location.href='{% url 'student_myapp:resetpassword' %}'
                } else {
                    window.location.href='{% url 'student_myapp:student_login' %}';
                }
                // 清除定时器，如果没有清除定时器，则会变-1、-2、-3......
                clearInterval(cleartim)
            }

            // 显示i的值
            document.getElementById('sp').innerHTML = i;
            i--;

        }
    </script>
</body>
</html>